// 下边的功能是做 excel导入时的格式转换
function formatExcelDate(numb, format = '/') {
  const time = new Date((numb - 25567) * 24 * 3600000 - 5 * 60 * 1000 - 43 * 1000 - 24 * 3600000 - 8 * 3600000)
  time.setYear(time.getFullYear())
  const year = time.getFullYear() + ''
  const month = time.getMonth() + 1 + ''
  const date = time.getDate() + ''
  if (format && format.length === 1) {
    return year + format + month + format + date
  }
  return year + (month < 10 ? '0' + month : month) + (date < 10 ? '0' + date : date)
}
const userRelations = {
  '入职日期': 'timeOfEntry',
  '手机号': 'mobile',
  '姓名': 'username',
  '转正日期': 'correctionTime',
  '工号': 'workNumber',
  '部门': 'departmentName',
  '聘用形式': 'formOfEmployment'
}
// 源数据
const results = [
  { '姓名': '小张', '手机号': '13800000152', '入职日期': 44505, '转正日期': 44892, '工号': '9002', '部门': '总裁办' },
  { '姓名': '小李', '手机号': '13800000512', '入职日期': 44506, '转正日期': 44893, '工号': 9006, '部门': '总裁办' }
]
function fn(results) {
  return results.map(item => {
    const newObj = {}
    Object.keys(item).forEach(keys => {
      const enKey = userRelations[keys]
      if (enKey === 'correctionTime' || enKey === 'timeOfEntry') {
        newObj[enKey] = new Date(formatExcelDate(item[keys]))
      } else {
        newObj[enKey] = item[keys]
      }
    })
    return newObj
  })
}
fn(results)
